package com.hhf.demo_03;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @Author: 黄恒锋
 * @DateTime: 2024/5/11 18:31
 * @Description: TODO
 */
public class App {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable myCallable = new MyCallable();
        FutureTask<Integer> futureTask = new FutureTask<Integer>(myCallable);
        Thread t1 = new Thread(futureTask);
        t1.start();
        Integer result = futureTask.get();
        System.out.println(result);
    }
}
